# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-python-ntlm3
pkgname=('python2-python-ntlm3' 'python-python-ntlm3')
_pkgname=python-ntlm3
pkgver=1.0.2
pkgrel=9
pkgdesc='Python 3 compatible NTLM library.'
arch=('any')
url='https://pypi.org/project/python-ntlm3/#files'
license=('GPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('de51d404b71d1910584d510d845051177da02017bace6f4442598491a23932c9211af4922820c200608863049ae0427a6cb6321a01cec09bf38f6b9da49228ed')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-python-ntlm3() {
  depends=('python2' 'python2-six')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-python-ntlm3() {
  depends=('python' 'python-six')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

